package com.hightemperator.util;

import com.aliyun.oss.OSSClient;

import java.io.File;
import java.util.UUID;

/**
 * @
 * @author MengJinyue
 * @date 2018年3月19日 下午9:56:48
 * 
 */
public class OSSUtil {

	public static String uploadFile(File file){
		OSSClient ossClient = new OSSClient(Constant.END_PONINT_HTTP, Constant.ACCESS_KEY_ID, Constant.ACCESS_KEY_SECRET);
        String backgroundImg = UUID.randomUUID().toString().replaceAll("-", "");
        ossClient.putObject(Constant.BUCKET_NAME,backgroundImg,file);
        ossClient.shutdown();
		return backgroundImg;
	}
}
